package com.coalmine.activiti.webadmin.upms.model;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.coalmine.common.core.annotation.Excel;
import com.coalmine.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.ArrayList;
import java.util.List;

/**
 * 单定义对象 form_config
 *
 * @author coalmine
 * @date 2022-04-27
 */
public class FormConfig extends BaseEntity
{
    private static final long serialVersionUID = 1L;


    /** 表单ID */
    private String formId;

    /** 父级id */
    @Excel(name = "父级id")
    private String parentId;

    /** 表单编码 */
    @Excel(name = "表单编码")
    private String formCode;

    /** 表单名称 */
    @Excel(name = "表单名称")
    private String formName;

    /** 配置数据 */
    @Excel(name = "配置数据")
    private JSONObject formDefJson;

    /** 表单版本 */
    @Excel(name = "表单版本")
    private Long formVersion;

    /** 发布状态，0草稿，1已发布，2历史版本 */
    @Excel(name = "发布状态，0草稿，1已发布，2历史版本")
    private String deploy;

    /** 子表单索引 */
    @Excel(name = "子表单索引")
    private Long formIndex;

    /** 模板类型 0 单表  1主从表 */
    private String tplType;
    /**模板路径 */
    private String tplPath;
    /**模板json*/
    private JSONArray cfgList;

    private String cfgLista;
    /**模板名称*/
    private String templateName;
    /**业务对象名称*/
    private String objectName;

    private String templateId;

    private String objectId;


    /**使用工具*/
    private String formTool;
    /**表单分类*/
    private String formType;
    private List<FormConfig> children = new ArrayList<FormConfig>();
    public void setFormId(String formId)
    {
        this.formId = formId;
    }

    public String getFormId()
    {
        return formId;
    }
    public void setParentId(String parentId)
    {
        this.parentId = parentId;
    }

    public String getParentId()
    {
        return parentId;
    }

    public void setFormCode(String formCode)
    {
        this.formCode = formCode;
    }

    public String getFormCode()
    {
        return formCode;
    }

    public void setFormName(String formName)
    {
        this.formName = formName;
    }

    public String getFormName()
    {
        return formName;
    }

    public JSONObject getFormDefJson() {
        return formDefJson;
    }

    public void setFormDefJson(JSONObject formDefJson) {
        this.formDefJson = formDefJson;
    }

    public void setFormVersion(Long formVersion)
    {
        this.formVersion = formVersion;
    }

    public Long getFormVersion()
    {
        return formVersion;
    }
    public void setDeploy(String deploy)
    {
        this.deploy = deploy;
    }

    public String getDeploy()
    {
        return deploy;
    }
    public void setFormIndex(Long formIndex)
    {
        this.formIndex = formIndex;
    }

    public Long getFormIndex()
    {
        return formIndex;
    }

    public List<FormConfig> getChildren() {
        return children;
    }

    public void setChildren(List<FormConfig> children) {
        this.children = children;
    }

    public String getTplType() {
        return tplType;
    }

    public void setTplType(String tplType) {
        this.tplType = tplType;
    }

    public String getTplPath() {
        return tplPath;
    }

    public void setTplPath(String tplPath) {
        this.tplPath = tplPath;
    }

    public JSONArray getCfgList() {
        JSONArray jsonArray = JSONArray.parseArray(this.cfgLista);
        return jsonArray;
    }

    public void setCfgList(JSONArray cfgList) {
        this.cfgList = cfgList;
    }

    public String getCfgLista() {
        return cfgLista;
    }

    public void setCfgLista(String cfgLista) {
        this.cfgLista = cfgLista;
    }

    public String getTemplateName() {
        return templateName;
    }

    public void setTemplateName(String templateName) {
        this.templateName = templateName;
    }

    public String getObjectName() {
        return objectName;
    }

    public void setObjectName(String objectName) {
        this.objectName = objectName;
    }

    public String getTemplateId() {
        return templateId;
    }

    public void setTemplateId(String templateId) {
        this.templateId = templateId;
    }

    public String getObjectId() {
        return objectId;
    }

    public void setObjectId(String objectId) {
        this.objectId = objectId;
    }

    public String getFormTool() {
        return formTool;
    }

    public void setFormTool(String formTool) {
        this.formTool = formTool;
    }

    public String getFormType() {
        return formType;
    }

    public void setFormType(String formType) {
        this.formType = formType;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("formId", getFormId())
            .append("parentId", getParentId())
            .append("formCode", getFormCode())
            .append("formName", getFormName())
            .append("configData", getFormDefJson())
            .append("formVersion", getFormVersion())
            .append("deploy", getDeploy())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("remark", getRemark())
            .append("formIndex", getFormIndex())
            .append("formType",getFormType())
            .append("children",getChildren())
            .toString();
    }
}
